home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / TransSkel 3.24 / Source / Dialog Item Stuff / SkelSetRadio.c < prev    next >
Text File  |  1996-01-17  |  489b  |  23 lines

  1. /*
  2.  * Given a set of contiguous radio button dialog items, turn one of them
  3.  * on and all others off.
  4.  */
  5.  
  6. # include    "TransSkel.h"
  7.  
  8.  
  9. pascal void
  10. SkelSetDlogRadioButtonSet (DialogPtr dlog, short first, short last, short choice)
  11. {
  12. ControlHandle    ctrl;
  13. short            i, value;
  14.  
  15.     for (i = first; i <= last; i++)
  16.     {
  17.         value = (i == choice ? 1 : 0);
  18.         ctrl = SkelGetDlogCtl (dlog, i);
  19.         if (GetControlValue (ctrl) != value)    /* don't set unless it's different! */
  20.             SetControlValue (ctrl, value);
  21.     }
  22. }
  23.